listbox: add support for :first-child, :last-child and others
authorChristian Hergert <christian@hergert.me>
Sat, 30 May 2015 03:03:11 +0000 (20:03 -0700)
committerChristian Hergert <christian@hergert.me>
Sat, 30 May 2015 03:03:11 +0000 (20:03 -0700)
commitaa07c40748777d38b726863475794255551bb52b
tree12a64478dea2157e2a4b0c26d0c2ed783f204ad5
parentbb93c1cecd23e487d04e005cb89eb09f8d4e2d0b
listbox: add support for :first-child, :last-child and others

This applies the proper CSS child ordering semantics using GtkCssNode to
GtkListBox. You can now use :first-child, :last-child, :nth-child(), and
:last-nth-child() selectors.

For example, this allows styling row separators using CSS while ignoring
the separator on the last row.

 GtkListBoxRow {
   border-bottom: 1px solid @borders;
 }
 GtkListBoxRow:last-child {
   border-bottom: none;
 }

When the sort ordering of the listbox changes, we also update the CSS
node ordering.
gtk/gtklistbox.c